﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Page/MasterPage.master" AutoEventWireup="true"
    CodeFile="CommentManagement.aspx.cs" Inherits="Page_CommentManagement" %>

<%@ Register Src="UserControl/ContentHeader.ascx" TagName="ContentHeader" TagPrefix="uc1" %>
<%@ Register Src="UserControl/Message.ascx" TagName="Message" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
 <script type="text/javascript">
     $(document).ready(function () {
         $("#<%= TextBox_StartDate.ClientID %>").datepicker();
     });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <uc1:ContentHeader ID="ContentHeader1" PageTitle="Advertisement List Management"
        runat="server" GoToLabel="Add New" GoToLink="AddEditAdvertisement.aspx" />
    <div class="body_content">
        <uc2:Message ID="Message_Alert" runat="server" />
        <asp:UpdateProgress ID="UpdateProgress_Main" AssociatedUpdatePanelID="UpdatePanelContent"
            runat="server" DynamicLayout="true" DisplayAfter="0">
            <ProgressTemplate>
                <div class="overlay">
                    <div class="loader">
                        <img id="Img1" runat="server" alt="Loading..." src="../App_Themes/img_data/loading.gif"
                            width="25" />
                    </div>
                </div>
            </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanelContent" runat="server" OnLoad="UpdatePanelContent_Load">
            <ContentTemplate>
                <div id="searchpanel" class="df_tbl_func_row">
                    <div class="formrow">
                        <label class="lb_small fl">
                            <%= Resources.News.Keyword%></label>
                        <div class="form_filed fl">
                            <asp:TextBox ID="TextBox_Title" CssClass="textbox_small" runat="server"></asp:TextBox></div>
                        <div class="form_filed fl">
                            <label class="lb fl">
                                <%= Resources.Comment.CreateDate%></label>
                            <asp:TextBox ID="TextBox_StartDate" CssClass="textbox_smaller" runat="server"></asp:TextBox>
                        </div>
                        <div class="form_filed fl">
                            <asp:DropDownList ID="DropDownList_Status" runat="server" CssClass="select">
                                <asp:ListItem Selected="True" Text="--All Status --" Value=""></asp:ListItem>
                                <asp:ListItem Text="Activated" Value="1"></asp:ListItem>
                                <asp:ListItem Text="Inactive" Value="0"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                        <div class="df_ibtn fl">
                            <asp:Button ID="Button_Search" runat="server" Text="Search" OnClick="Button_Search_Click" />
                        </div>
                        <div class="df_ibtn fl">
                            <asp:Button ID="Button_Cancel" runat="server" Text="Refresh" OnClick="Button_Cancel_Click" />
                        </div>
                        <div class="clr">
                        </div>
                    </div>
                </div>
                <asp:Literal ID="Literal_PagingListTop" runat="server"></asp:Literal>
                <table width="100%" cellspacing="0" cellpadding="0" class="df_table">
                    <tr>
                        <th style="width: 15%">
                            Comment Title
                        </th>
                        <th>
                            Detail
                        </th>
                        <th style="width: 10%">
                            Created By
                        </th>
                        <th style="width: 10%">
                            Date
                        </th>
                        <th style="width: 3%" class="center">
                            Status
                        </th>
                        <th style="width: 2%" class="center">
                        </th>
                    </tr>
                    <asp:Repeater runat="server" ID="Repeater_Content" OnItemCommand="Repeater_Content_ItemCommand">
                        <ItemTemplate>
                            <tr class="<%# Container.ItemIndex % 2 == 0 ? "odd" : "even" %>">
                                <td>
                                    <%# EasyCode.Utility.Protector.String(Eval("CommentTitle"))%>
                                </td>
                                <td>
                                    <%# EasyCode.Utility.Protector.String(Eval("CommentDetail"))%>
                                </td>
                                <td align="right">
                                    <%# Eval("CreatedBy")%>
                                </td>
                                <td align="right">
                                    <%# EasyCode.Utility.Protector.DateTime(Eval("CreatedDate")).ToShortDateString()%>
                                </td>
                                <td align="center">
                                    <asp:LinkButton runat="server" ID="LinkButton_ChangeStatus" ToolTip='Change this item status'
                                        OnClientClick='return ConfirmAction("Are you sure you want to change the selected item status?");'
                                        CommandName="LockUnLockCommand" CommandArgument='<%# Eval("CommentTitleID") %>'>
                                    <%# EasyCode.Utility.Protector.Bool(Eval("Status"), false) ? "<img src='../App_Themes/themes/default/images/func_icons/checked.png' alt='' />" : "<img src='../App_Themes/themes/default/images/func_icons/uncheck.png' alt='' />"%>
                                    </asp:LinkButton>
                                </td>
                                <td class="center">
                                    <asp:LinkButton runat="server" ID="LinkButton_Delete" ToolTip="Delete" CommandName="DeleteCommand"
                                        CssClass="del_icon" CausesValidation="false" CommandArgument='<%# Eval("CommentTitleID") %>'
                                        OnClientClick='return ConfirmAction("Are you sure you want to permanently delete the selected item?");'></asp:LinkButton>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr runat="server" id="tr_not_found" visible="false">
                        <td colspan="6">
                            Data not found.
                        </td>
                    </tr>
                </table>
                <asp:Literal ID="Literal_PagingListBot" runat="server"></asp:Literal>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <script type="text/javascript">
        function loadpage(page) {
            __doPostBack('<%= UpdatePanelContent.ClientID %>', page + '|page');
        }
        function ConfirmAction(message) {
            return confirm(message);
        }
    </script>
</asp:Content>
